#pragma once
/*	Initial Author: Borja De La Viuda
*	Modified By: Monica ||Enter Names of people which modified this class here if any||
*	Description: Spawner to randomly place obstacles around it
*	Basically this is to replace the createCubeEntity etc... methods in MyGame, 
*	but with adding a random placement element (around a point) not yet implemented as I need to decide how (straight up random distance along x of the point? set positions and random selection of position?)
*/
#include "EntityFreeList.h"
#include "../nclgl/OBJMesh.h"
#include "TerrainClass.h"
#include <random>
class Spawner
{
public:
	Spawner(Vector3 initial, int freeList_space);
	~Spawner();
	//setter and getter methods for this class
#pragma region set&get
	//We want to be able to update the position of the spawn point as the player is advancing through the world
	void setPosition(Vector3& pos)
	{
		position = pos;
	}

	Vector3 getPosition()
	{
		return position;
	}

#pragma endregion set&get


	GameEntity* spawn(int type);

	void despawn(GameEntity* obj);

	void flipAcitve(){ active = !active; }
	bool isActive(){ return active; }

	// ---- Added by Monica ---- //
	void setTerrainEntity(TerrainClass* terr) { terrain = terr; }
	// ----------------------------- //

protected:
	OBJMesh* mesh;
	Vector3 position;
	EntityFreeList* freeList;
	bool active;

	// ---- Added by Monica ----- //
	TerrainClass* terrain;
	// ---------------------------- //
};

